package edu.nctu.csie.jichang.dp.thread;

public class Future {
	public static void main(String[] args) {
		FutureClass tFutureClass = new FutureClass();
		tFutureClass.proxy = tFutureClass.readProxy();
		tFutureClass.show();
		try {Thread.sleep(3000);} catch (Exception e) {}
		tFutureClass.show();
	}
}
class FutureClass{
	String proxy;
	String readProxy(){
		new Thread() {
			public void run() {
				try {sleep(1000);} catch (Exception e) {}
				proxy = "ready";
			}
		}.start();
		return "proxy";
	}
	void show(){System.out.println(proxy);}
}